<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生日快乐特别版</title>
    <style>
        :root {
            --primary-color: #ff69b4;
            --secondary-color: #ff8e8e;
        }

        body {
            margin: 0;
            min-height: 100vh;
            background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
            overflow: hidden;
            font-family: 'Comic Sans MS', cursive;
            position: relative;
        }

        .container {
            position: relative;
            text-align: center;
            padding-top: 15vh;
            z-index: 1;
        }

        h1 {
            font-size: 3.5rem;
            color: #fff;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            animation: bounce 1.5s infinite;
            margin-bottom: 30px;
        }

        .photo-frame {
            width: 300px;
            height: 300px;
            margin: 0 auto;
            border: 15px solid #fff;
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            position: relative;
        }

        .photo-slider {
            display: flex;
            transition: transform 0.8s ease;
        }

        .photo-slider img {
            width: 300px;
            height: 300px;
            object-fit: cover;
            flex-shrink: 0;
        }

        .controls {
            margin-top: 30px;
        }

        button {
            padding: 12px 25px;
            margin: 0 10px;
            border: none;
            border-radius: 25px;
            background: linear-gradient(45deg, #ff7eb3, #ff758c);
            color: white;
            cursor: pointer;
            transition: transform 0.3s;
        }

        button:hover {
            transform: scale(1.1) rotate(-3deg);
        }

        .hearts {
            position: fixed;
            pointer-events: none;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 0;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }

        @keyframes fall {
            0% { transform: translateY(-20vh) rotate(0deg); opacity: 1; }
            100% { transform: translateY(120vh) rotate(360deg); opacity: 0; }
        }

        .music-control {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgba(255,255,255,0.8);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
    </style>
</head>
<body>
    <div class="hearts"></div>
    
    <div class="container">
        <h1>🎂 生日快乐！ 🎉</h1>
        
        <div class="photo-frame">
            <div class="photo-slider">
                <img src="photo1.jpg" alt="回忆照片1">
                <img src="photo2.jpg" alt="回忆照片2">
                <img src="photo3.jpg" alt="回忆照片3">
            </div>
        </div>

        <div class="controls">
            <button onclick="showSpecialMessage()">点我惊喜✨</button>
            <button onclick="changeBackground()">换背景🎨</button>
        </div>
    </div>

    <div class="music-control" onclick="toggleMusic()">🎵</div>

    <audio id="bgm" loop>
        <source src="birthday_music.mp3" type="audio/mpeg">
    </audio>

    <script>
        // 爱心动画
        function createHearts() {
            const container = document.querySelector('.hearts');
            for(let i = 0; i < 20; i++) {
                const heart = document.createElement('div');
                heart.innerHTML = '❤';
                heart.style.cssText = `
                    position: absolute;
                    left: ${Math.random() * 100}%;
                    font-size: ${Math.random() * 20 + 20}px;
                    animation: fall ${Math.random() * 3 + 5}s linear infinite;
                    color: #ff4081;
                `;
                container.appendChild(heart);
            }
        }

        // 照片轮播
        let currentPhoto = 0;
        const slider = document.querySelector('.photo-slider');
        function nextPhoto() {
            currentPhoto = (currentPhoto + 1) % 3;
            slider.style.transform = `translateX(-${currentPhoto * 100}%)`;
        }
        setInterval(nextPhoto, 3000);

        // 背景音乐控制
        const audio = document.getElementById('bgm');
        function toggleMusic() {
            audio.paused ? audio.play() : audio.pause();
        }

        // 特别消息
        function showSpecialMessage() {
            const msg = document.createElement('div');
            msg.innerHTML = '🎁 愿你每天都能收获美好与惊喜！';
            msg.style.cssText = `
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                background: rgba(255,255,255,0.9);
                padding: 20px;
                border-radius: 15px;
                animation: bounce 1s infinite;
            `;
            document.body.appendChild(msg);
            setTimeout(() => msg.remove(), 2000);
        }

        // 更换背景
        function changeBackground() {
            const colors = ['#ff6b6b', '#ff8e8e', '#ff69b4', '#ff7f50'];
            document.body.style.background = 
                `linear-gradient(45deg, ${colors[Math.floor(Math.random()*4)]}, ${colors[Math.floor(Math.random()*4)]})`;
        }

        // 初始化
        createHearts();
        setInterval(createHearts, 3000);
    </script>
</body>
</html>
